package com.szd.qiongyou20.home.search.presenter;

import com.szd.qiongyou20.home.search.bean.GoodsBean;
import com.szd.qiongyou20.home.search.modle.LoadSearchData;
import com.szd.qiongyou20.home.search.modle.SearchData;
import com.szd.qiongyou20.home.search.modle.SearchGoodsListener;
import com.szd.qiongyou20.home.search.view.GoodsDataToView;

/**
 * Created by SZD on 2016/12/26.
 */

public class GoodsPre {

    private SearchData mSearchData;
    private GoodsDataToView mGoodsDataToView;
//    private String keyword;

    public GoodsPre(GoodsDataToView goodsDataToView, String keyword) {
        mGoodsDataToView = goodsDataToView;
        mSearchData = new LoadSearchData(keyword);
    }

    public void loadDataToView(){
        mSearchData.searchGoodsData(new SearchGoodsListener() {
            @Override
            public void searchSuccess(GoodsBean goodsBean) {
                mGoodsDataToView.DataToView(goodsBean);
            }

            @Override
            public void searchFaile(String string) {

            }
        });
    }
}
